package gongchang;


public class Coffeestore {
    public static void main(String[] args) {
        Coffeestore coffeestore = new Coffeestore(new CFB());
        Coffee coffee = coffeestore.CreateCoffee();
        System.out.println(coffee.getname());
    }
    private CoffeeFactory coffeeFactory;
    public Coffeestore(CoffeeFactory coffeeFactory){
        this.coffeeFactory = coffeeFactory;
    }
    public Coffee CreateCoffee(){
        Coffee coffee = coffeeFactory.CreateCoffee();
        coffee.addmilk();
        coffee.addSuger();
        return coffee;
    }
}
